<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<meta charset="UTF-8" />
<title>Insert title here</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<script type="text/javascript" th:src="@{/static/js/jquery-2.1.4.js}"></script>
<link th:href="@{/static/css/style.css}" rel="stylesheet" type="text/css" />
<link th:href="@{/static/css/bootstrap-combined.min.css}" rel="stylesheet" type="text/css" />
<script type="javascript">
$(function(){   
    //导航切换
    $(".imglist li").click(function(){
        $(".imglist li.selected").removeClass("selected")
        $(this).addClass("selected");
    })
})  
</script>
</head>
<body>
	<div class="place">
		<span>位置：</span>
		<ul class="placeul">
			<li><a href="#">首页</a></li>
			<li><a href="#">教练列表</a></li>
		</ul>
	</div>
	<span th:if="${session.user.teacher_id eq null}">
		<a th:href="@{/teacher/add}">增加</a>
	</span>
	
	<table class="imgtable">
	  <thead>
	    <tr>
	      <th>教师名称</th>
	      <th>教师年龄</th>
	      <th>教师性别</th>
	      <th>是否锁定</th>
	      <th>教师等级</th>
	      <th>操作</th>
	    </tr>
	  </thead>
	  <tbody>
	    <tr th:each="teacher : ${teacherPage.list}" >
	      <td th:text="${teacher.username}">1,001</td>
	      <td th:text="${teacher.age}">Lorem</td>
	      <td th:text="${teacher.gender}">Lorem</td>
	      <td th:text="${teacher.locked}">Lorem</td>
	      <td th:text="${teacher.rank}">Lorem</td>
	      <td th:if="${session.user.teacher_id eq null}">
	      	<a th:href="'/membership/teacher/edit/'+${teacher.id}+'/'+${currentPage}" style="margin-right: 10%;"><img	th:src="@{/static/images/bian.png}">&nbsp;&nbsp;编辑</a>
	        <a th:href="'/membership/teacher/delete/' + ${teacher.id }+'/'+${currentPage}"><img th:src="@{/static/images/shan.png}">&nbsp;&nbsp;删除</a>
	      </td>
	      <td th:if="${session.user.teacher_id ne null}">
	      	<a th:href="'/membership/teacher/edit/'+${teacher.id}+'/'+${currentPage}" style="margin-right: 10%;"><img	th:src="@{/static/images/bian.png}">&nbsp;&nbsp;编辑</a>
	      </td>
	    </tr>
	  </tbody>
	</table>
	
	<div class="pagin">
		<div class="message">
			共<i class="blue" th:text="${teacherPage.page.count}"></i>条记录，页次&nbsp;<i
				class="blue" th:text="${currentPage }+'/'+${teacherPage.page.total }">&nbsp;</i>页
		</div>
		<ul class="paginList" th:if="${teacherPage.page.endPageIndex ne 0}">
			 <!-- <a href="javascript:;"><span class="pagepre"></span></a> -->
			<li class="paginItem"><a href="javascript: gotoPage(1)"
				th:text="首页" style="cursor: hand;"> <span class="pagepre"></span>
			</a></li>
			<li th:each="num : ${#numbers.sequence(teacherPage.page.beginPageIndex, teacherPage.page.endPageIndex)}" class="paginItem">
				<a th:if="${num eq currentPage}" href="javascript:void(0);">
                   <font color="red" th:text="${num}"></font>
              	</a>
              	<a th:if="${not(num eq currentPage)}" th:href="'/membership/teacher/list/'+${num}">
                     <span th:text="${num}" class="PageSelectorNum" style="cursor: hand;"></span>
                 </a>
			</li>
			<li class="paginItem"><a th:text="尾页"
				th:href="'/membership/teacher/list/'+${teacherPage.page.total}"
				style="cursor: hand;"><span class="pagenxt"></span> </a></li>
		</ul>
	</div>
	</body>
	<script type="text/javascript">
    $('.imgtable tbody tr:odd').addClass('odd');
    </script>
	
<script type="text/javascript">
	function gotoPage( pageNum ){
		window.location.href = "/membership/course/list/" + pageNum;
	}
</script>
</html>